﻿using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Collections.Generic;
using System.Linq;
using GameSchool.Models;
using System.Data.Entity;
using GameSchool.Models.Common;

namespace GameSchool.Repository.Repositories.RuGameSchool
{
    public class RuGameSchoolRepository : GameSchool.Repository.IGameSchoolRepository //, System.Data.Entity.Infrastructure.IObjectContextAdapter
    {
        RuGameSchoolContext m_access;

        public RuGameSchoolRepository() 
		{
            m_access = new RuGameSchoolContext();
        }
        
		public bool LazyLoading
        {
            get
            {
                return m_access.Configuration.LazyLoadingEnabled;
            }
            set 
            {
                m_access.Configuration.LazyLoadingEnabled = value;
            }
        }

        public DbSet<Person> Persons
        {
            get
            {
                return m_access.Persons;
            }
        }

		public DbSet<Assignment> Assignments 
		{
			get
			{
				return m_access.Assignments;
			}
		}

        public DbSet<Course> Courses
        {
            get
            {
                return m_access.Courses;
            }
        }

        public DbSet<Level> Levels
        {
            get
            {
                return m_access.Levels;
            }
        }
  
        public DbSet<Notification> Notifications
        {
           get
           {
               return m_access.Notifications;
           }
        }

        public DbSet<LevelParticipate> LevelParticipates
        {
            get
            {
                return m_access.LevelParticipates;
            }
        }

        public DbSet<StudentCourse> StudentCourses
        {
            get
            {
                return m_access.StudentCourse;
            }
        }

        public DbSet<TeacherCourse> TeacherCourses
        {
            get
            {
                return m_access.TeacherCourse;
            }
        }

        public DbSet<VideoLecture> VideoLectures
        {
            get
            {
                return m_access.VideoLectures;
            }
        }    
   
		public int SaveChanges()
        {
           return m_access.SaveChanges();
        }

        public void Dispose()
        {
            m_access.Dispose();
            
        }
    }
}
